﻿USE [master]
GO
/****** Object:  Database [Hamaazan]    Script Date: 09/18/2012 09:55:44 ******/
CREATE DATABASE [Hamaazan] ON  PRIMARY 
( NAME = N'Hamaazan', FILENAME = N'd:\Program Files\Microsoft SQL Server\MSSQL10_50.ROI2008R2\MSSQL\DATA\Hamaazan.mdf' , SIZE = 3072KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
 LOG ON 
( NAME = N'Hamaazan_log', FILENAME = N'd:\Program Files\Microsoft SQL Server\MSSQL10_50.ROI2008R2\MSSQL\DATA\Hamaazan_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO
ALTER DATABASE [Hamaazan] SET COMPATIBILITY_LEVEL = 100
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [Hamaazan].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO
ALTER DATABASE [Hamaazan] SET ANSI_NULL_DEFAULT OFF
GO
ALTER DATABASE [Hamaazan] SET ANSI_NULLS OFF
GO
ALTER DATABASE [Hamaazan] SET ANSI_PADDING OFF
GO
ALTER DATABASE [Hamaazan] SET ANSI_WARNINGS OFF
GO
ALTER DATABASE [Hamaazan] SET ARITHABORT OFF
GO
ALTER DATABASE [Hamaazan] SET AUTO_CLOSE OFF
GO
ALTER DATABASE [Hamaazan] SET AUTO_CREATE_STATISTICS ON
GO
ALTER DATABASE [Hamaazan] SET AUTO_SHRINK OFF
GO
ALTER DATABASE [Hamaazan] SET AUTO_UPDATE_STATISTICS ON
GO
ALTER DATABASE [Hamaazan] SET CURSOR_CLOSE_ON_COMMIT OFF
GO
ALTER DATABASE [Hamaazan] SET CURSOR_DEFAULT  GLOBAL
GO
ALTER DATABASE [Hamaazan] SET CONCAT_NULL_YIELDS_NULL OFF
GO
ALTER DATABASE [Hamaazan] SET NUMERIC_ROUNDABORT OFF
GO
ALTER DATABASE [Hamaazan] SET QUOTED_IDENTIFIER OFF
GO
ALTER DATABASE [Hamaazan] SET RECURSIVE_TRIGGERS OFF
GO
ALTER DATABASE [Hamaazan] SET  DISABLE_BROKER
GO
ALTER DATABASE [Hamaazan] SET AUTO_UPDATE_STATISTICS_ASYNC OFF
GO
ALTER DATABASE [Hamaazan] SET DATE_CORRELATION_OPTIMIZATION OFF
GO
ALTER DATABASE [Hamaazan] SET TRUSTWORTHY OFF
GO
ALTER DATABASE [Hamaazan] SET ALLOW_SNAPSHOT_ISOLATION OFF
GO
ALTER DATABASE [Hamaazan] SET PARAMETERIZATION SIMPLE
GO
ALTER DATABASE [Hamaazan] SET READ_COMMITTED_SNAPSHOT OFF
GO
ALTER DATABASE [Hamaazan] SET HONOR_BROKER_PRIORITY OFF
GO
ALTER DATABASE [Hamaazan] SET  READ_WRITE
GO
ALTER DATABASE [Hamaazan] SET RECOVERY FULL
GO
ALTER DATABASE [Hamaazan] SET  MULTI_USER
GO
ALTER DATABASE [Hamaazan] SET PAGE_VERIFY CHECKSUM
GO
ALTER DATABASE [Hamaazan] SET DB_CHAINING OFF
GO
USE [Hamaazan]
GO
/****** Object:  Table [dbo].[ContentTags]    Script Date: 09/18/2012 09:55:46 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ContentTags](
	[TagId] [uniqueidentifier] NOT NULL,
	[ContentId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK_ContentTags] PRIMARY KEY CLUSTERED 
(
	[TagId] ASC,
	[ContentId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Content]    Script Date: 09/18/2012 09:55:46 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Content](
	[Id] [uniqueidentifier] NOT NULL,
	[Name] [nvarchar](50) NULL,
 CONSTRAINT [PK_Content] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Figures]    Script Date: 09/18/2012 09:55:46 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Figures](
	[Id] [uniqueidentifier] NOT NULL,
	[Name] [nvarchar](50) NULL,
	[CreateDate] [datetime] NULL,
	[FirstName] [nvarchar](50) NULL,
	[LastName] [nvarchar](50) NULL,
	[CurrentTitle] [nvarchar](50) NULL,
 CONSTRAINT [PK_Figures] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Tags]    Script Date: 09/18/2012 09:55:46 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Tags](
	[Id] [uniqueidentifier] NOT NULL,
	[Name] [nvarchar](50) NULL,
	[CreateDate] [datetime] NULL,
 CONSTRAINT [PK_Tags] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Operator]    Script Date: 09/18/2012 09:55:46 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Operator](
	[Id] [uniqueidentifier] NOT NULL,
	[Name] [nchar](10) NULL,
 CONSTRAINT [PK_Operator] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[NewsStreams]    Script Date: 09/18/2012 09:55:46 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[NewsStreams](
	[Id] [uniqueidentifier] NOT NULL,
	[Title] [nvarchar](1024) NULL,
	[Url] [nvarchar](1024) NULL,
	[Content] [ntext] NULL,
 CONSTRAINT [PK_NewsStreams] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  Table [dbo].[FigureTags]    Script Date: 09/18/2012 09:55:46 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[FigureTags](
	[FigureId] [uniqueidentifier] NOT NULL,
	[TagId] [uniqueidentifier] NOT NULL
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[FigureNewsStreams]    Script Date: 09/18/2012 09:55:46 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[FigureNewsStreams](
	[FigureId] [uniqueidentifier] NULL,
	[NewsStreamId] [uniqueidentifier] NULL
) ON [PRIMARY]
GO
/****** Object:  Default [DF_Figures_Id]    Script Date: 09/18/2012 09:55:46 ******/
ALTER TABLE [dbo].[Figures] ADD  CONSTRAINT [DF_Figures_Id]  DEFAULT (newid()) FOR [Id]
GO
/****** Object:  Default [DF_NewsStreams_Id]    Script Date: 09/18/2012 09:55:46 ******/
ALTER TABLE [dbo].[NewsStreams] ADD  CONSTRAINT [DF_NewsStreams_Id]  DEFAULT (newid()) FOR [Id]
GO
/****** Object:  ForeignKey [FK_FigureTags_Figures]    Script Date: 09/18/2012 09:55:46 ******/
ALTER TABLE [dbo].[FigureTags]  WITH CHECK ADD  CONSTRAINT [FK_FigureTags_Figures] FOREIGN KEY([FigureId])
REFERENCES [dbo].[Figures] ([Id])
GO
ALTER TABLE [dbo].[FigureTags] CHECK CONSTRAINT [FK_FigureTags_Figures]
GO
/****** Object:  ForeignKey [FK_FigureTags_Tags]    Script Date: 09/18/2012 09:55:46 ******/
ALTER TABLE [dbo].[FigureTags]  WITH CHECK ADD  CONSTRAINT [FK_FigureTags_Tags] FOREIGN KEY([TagId])
REFERENCES [dbo].[Tags] ([Id])
GO
ALTER TABLE [dbo].[FigureTags] CHECK CONSTRAINT [FK_FigureTags_Tags]
GO
/****** Object:  ForeignKey [FK_FigureNewsStreams_Figures]    Script Date: 09/18/2012 09:55:46 ******/
ALTER TABLE [dbo].[FigureNewsStreams]  WITH CHECK ADD  CONSTRAINT [FK_FigureNewsStreams_Figures] FOREIGN KEY([FigureId])
REFERENCES [dbo].[Figures] ([Id])
GO
ALTER TABLE [dbo].[FigureNewsStreams] CHECK CONSTRAINT [FK_FigureNewsStreams_Figures]
GO
/****** Object:  ForeignKey [FK_FigureNewsStreams_NewsStreams]    Script Date: 09/18/2012 09:55:46 ******/
ALTER TABLE [dbo].[FigureNewsStreams]  WITH CHECK ADD  CONSTRAINT [FK_FigureNewsStreams_NewsStreams] FOREIGN KEY([NewsStreamId])
REFERENCES [dbo].[NewsStreams] ([Id])
GO
ALTER TABLE [dbo].[FigureNewsStreams] CHECK CONSTRAINT [FK_FigureNewsStreams_NewsStreams]
GO
